package com.qf.air.fallback;

import com.qf.air.clinet.AirSearchClient;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author 10537
 * @version V1.0
 * @Date 2021/11/11 19:21
 */
@Component
public class AirSearchClientFallback implements AirSearchClient {

    /**
     * 目标服务中search功能的降级方法，返回结果是托底数据
     * @param map
     * @return
     */
    @Override
    public Map<String, Object> getSearchResponse(Map map) {
        Map<String, Object> result=new HashMap<>();
        result.put("error","服务器挤爆了，请稍候尝试");
        return result;
    }

    @Override
    public List<Map> getDistrictNameEcharts() {
        return null;
    }
}
